package com.burstly.lib.component.networkcomponent.burstly.html;

import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.burstly.lib.component.AbstractAdaptor.AdaptorListenerWrapper;
import com.burstly.lib.component.IBurstlyAdaptorListener;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

class RedirectClickListener extends WebViewClient
  implements IRichMediaAdListener, Runnable
{
  private static final int CLICKABLE_DELAY = 3000;
  private final RedirectAwareClickHandler mClickHandler;
  private volatile boolean mClickable = true;
  private IRichMediaAdListener mOriginalListener;
  private final ScheduledExecutorService mService = Executors.newSingleThreadScheduledExecutor();
  private final UrlProvider mUrlProvider;

  RedirectClickListener(AbstractAdaptor.AdaptorListenerWrapper paramAdaptorListenerWrapper, String paramString, boolean paramBoolean, UrlProvider paramUrlProvider)
  {
    this.mClickHandler = new RedirectAwareClickHandler(paramAdaptorListenerWrapper, paramString, paramBoolean);
    this.mUrlProvider = paramUrlProvider;
  }

  private void doClick(String paramString)
  {
    this.mUrlProvider.setUrl(paramString);
    this.mClickHandler.click(paramString);
  }

  IBurstlyAdaptorListener getAdaptorListener()
  {
    return this.mClickHandler.getListener();
  }

  String getNetworkName()
  {
    return this.mClickHandler.getNetworkName();
  }

  public IRichMediaAdListener getRichMediaListener()
  {
    return this.mOriginalListener;
  }

  public void handleRequest(String paramString)
  {
    if (this.mOriginalListener != null)
      this.mOriginalListener.handleRequest(paramString);
  }

  boolean isFullscreen()
  {
    return this.mClickHandler.isFullscreen();
  }

  public void onClick(String paramString)
  {
    if (this.mOriginalListener != null)
      this.mOriginalListener.onClick(paramString);
    doClick(paramString);
  }

  public boolean onEventFired()
  {
    return (this.mOriginalListener != null) && (this.mOriginalListener.onEventFired());
  }

  public boolean onExpand()
  {
    return (this.mOriginalListener != null) && (this.mOriginalListener.onExpand());
  }

  public boolean onExpandClose()
  {
    return (this.mOriginalListener != null) && (this.mOriginalListener.onExpandClose());
  }

  public void onHide()
  {
    if (this.mOriginalListener != null)
      this.mOriginalListener.onHide();
  }

  public void onPageFinished(WebView paramWebView, String paramString)
  {
    super.onPageFinished(paramWebView, paramString);
  }

  public boolean onReady()
  {
    return (this.mOriginalListener != null) && (this.mOriginalListener.onReady());
  }

  public boolean onResize()
  {
    return (this.mOriginalListener != null) && (this.mOriginalListener.onResize());
  }

  public boolean onResizeClose()
  {
    return (this.mOriginalListener != null) && (this.mOriginalListener.onResizeClose());
  }

  public void onShow()
  {
    if (this.mOriginalListener != null)
      this.mOriginalListener.onShow();
  }

  public void onTouchEvent()
  {
    if (this.mOriginalListener != null)
      this.mOriginalListener.onTouchEvent();
  }

  public void run()
  {
    this.mClickable = true;
  }

  public void setRichMediaListener(IRichMediaAdListener paramIRichMediaAdListener)
  {
    this.mOriginalListener = paramIRichMediaAdListener;
  }

  public void setStatisticsSender(StatisticsSender paramStatisticsSender)
  {
    if (this.mOriginalListener != null)
      this.mOriginalListener.setStatisticsSender(paramStatisticsSender);
  }

  public boolean shouldOverrideUrlLoading(WebView paramWebView, String paramString)
  {
    if (this.mClickable)
    {
      doClick(paramString);
      this.mClickable = false;
      this.mService.schedule(this, 3000L, TimeUnit.MILLISECONDS);
    }
    return true;
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.component.networkcomponent.burstly.html.RedirectClickListener
 * JD-Core Version:    0.6.2
 */